#ifndef HEAP_H
#define HEAP_H

#define HEAP_MAGIC	0x900DF00D //good_food

struct heap_header_t;

typedef struct heap_header
{
	u32int magic;
	u32int free;
	u32int size;
	struct heap_header *next;
	u32int magic1;
}heap_header_t;

typedef struct
{
	u32int start;
	u32int end;
	u32int min_chunck_size;

	heap_header_t *first_header;
}heap_t;

heap_t *create_heap(u32int start, u32int end);

u32int heap_alloc(heap_t *heap, u32int size);

void heap_free(heap_t *heap, void *p); 

#endif
